<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../../files/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper_rb.html">
                vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="AtomBuilder.html">
                AtomBuilder
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M002005">entry</a>&nbsp;&nbsp;
      <a href="#M002003">new</a>&nbsp;&nbsp;
      <a href="#M002004">updated</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M002003" class="method-detail">
        <a name="M002003"></a>

        <div class="method-heading">
          <a href="#M002003" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(xml, view, feed_options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002003-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002003-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb, line 160</span>
160:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">xml</span>, <span class="ruby-identifier">view</span>, <span class="ruby-identifier">feed_options</span> = {})
161:           <span class="ruby-ivar">@xml</span>, <span class="ruby-ivar">@view</span>, <span class="ruby-ivar">@feed_options</span> = <span class="ruby-identifier">xml</span>, <span class="ruby-identifier">view</span>, <span class="ruby-identifier">feed_options</span>
162:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M002005" class="method-detail">
        <a name="M002005"></a>

        <div class="method-heading">
          <a href="#M002005" class="method-signature">
          <span class="method-name">entry</span><span class="method-args">(record, options = {}) {|AtomBuilder.new(@xml)| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates an <a href="AtomFeedBuilder.html#M002005">entry</a> tag for a
specific record and prefills the id using class and id.
</p>
<p>
Options:
</p>
<ul>
<li><tt>:published</tt>: Time first published. Defaults to the created_at
attribute on the record if one such exists.

</li>
<li><tt>:<a href="AtomFeedBuilder.html#M002004">updated</a></tt>: Time of
update. Defaults to the updated_at attribute on the record if one such
exists.

</li>
<li><tt>:url</tt>: The URL for this <a
href="AtomFeedBuilder.html#M002005">entry</a>. Defaults to the
polymorphic_url for the record.

</li>
<li><tt>:id</tt>: The ID for this <a
href="AtomFeedBuilder.html#M002005">entry</a>. Defaults to
&quot;tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}&quot;

</li>
</ul>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002005-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002005-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb, line 177</span>
177:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entry</span>(<span class="ruby-identifier">record</span>, <span class="ruby-identifier">options</span> = {})
178:           <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">entry</span> <span class="ruby-keyword kw">do</span>
179:             <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">id</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:id</span>] <span class="ruby-operator">||</span> <span class="ruby-node">&quot;tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}&quot;</span>)
180: 
181:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:published</span>] <span class="ruby-operator">||</span> (<span class="ruby-identifier">record</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:created_at</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">created_at</span>)
182:               <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">published</span>((<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:published</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">created_at</span>).<span class="ruby-identifier">xmlschema</span>)
183:             <span class="ruby-keyword kw">end</span>
184: 
185:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:updated</span>] <span class="ruby-operator">||</span> (<span class="ruby-identifier">record</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:updated_at</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">updated_at</span>)
186:               <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">updated</span>((<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:updated</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">updated_at</span>).<span class="ruby-identifier">xmlschema</span>)
187:             <span class="ruby-keyword kw">end</span>
188: 
189:             <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">link</span>(<span class="ruby-identifier">:rel</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'alternate'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'text/html'</span>, <span class="ruby-identifier">:href</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:url</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@view</span>.<span class="ruby-identifier">polymorphic_url</span>(<span class="ruby-identifier">record</span>))
190: 
191:             <span class="ruby-keyword kw">yield</span> <span class="ruby-constant">AtomBuilder</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@xml</span>)
192:           <span class="ruby-keyword kw">end</span>
193:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002004" class="method-detail">
        <a name="M002004"></a>

        <div class="method-heading">
          <a href="#M002004" class="method-signature">
          <span class="method-name">updated</span><span class="method-args">(date_or_time = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Accepts a Date or Time object and inserts it in the proper format. If nil
is passed, current time in UTC is used.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002004-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002004-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb, line 165</span>
165:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updated</span>(<span class="ruby-identifier">date_or_time</span> = <span class="ruby-keyword kw">nil</span>)
166:           <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">updated</span>((<span class="ruby-identifier">date_or_time</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">utc</span>).<span class="ruby-identifier">xmlschema</span>)
167:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>